#ifndef EtatTypesH
    #define EtatTypesH
    //---------------------------------------------------------------------------
#include <limits.h>
#include <DB.hpp>
#define NO_TAG UINT_MAX
enum type_debutpage {
    Deb_AutreDocument = 0,
    Deb_PagePaire,
    Deb_PageImpaire,
    Deb_SuitePrec,
    Deb_PageSuiv,
    Deb_Max = Deb_PageSuiv
};

enum Text_Presentation {
    Tx_Aucun          = 0x00000000,
    Tx_HGauche        = 0x00000001,
    Tx_HCentre        = 0x00000002,
    Tx_HDroite        = 0x00000004,
    Tx_HJustify       = 0x00000008,
    Tx_VHaut          = 0x00000010,
    Tx_VCentre        = 0x00000020,
    Tx_VBas           = 0x00000040,
    Tx_VJustify       = 0x00000080,
    Tx_ALaLigne       = 0x00000100,
    Tx_Majuscule      = 0x00000200,
    Tx_Minuscule      = 0x00000400,
    Tx_PremLettreMaj  = 0x00000800,
    Tx_InitialeMaj    = 0x00001000,
    Tx_Extensible     = 0x00002000,
    Tx_DontTrim       = 0x00004000,
    Tx_FinPointilles  = 0x00008000,
    Tx_ModeFiligrane  = 0x00010000,
    Tx_PasMargesInt   = 0x00020000,
    Tx_Valide        = (Tx_HGauche     | Tx_HCentre    | Tx_HDroite   | Tx_HJustify      |
                        Tx_VHaut       | Tx_VCentre    | Tx_VBas      | Tx_VJustify      |
                        Tx_ALaLigne    | Tx_Majuscule  | Tx_Minuscule | Tx_PremLettreMaj |
                        Tx_InitialeMaj | Tx_Extensible | Tx_DontTrim  | Tx_FinPointilles |
                        Tx_ModeFiligrane | Tx_PasMargesInt)
};

enum Text_Format { tf_Normal, tf_Monetaire, tf_Booleen, tf_Date,  tf_CadreAdm, tf_Numerique, tf_Adresse, tf_Max = tf_Adresse};
#define ADR_IdxDenomination 0
#define ADR_IdxCmplAdr1     1
#define ADR_IdxCmplAdr2     2
#define ADR_IdxNoVoie       3
#define ADR_IdxCmplNoVoie   4
#define ADR_IdxNomVoie      5
#define ADR_IdxBP           6
#define ADR_IdxCP           7
#define ADR_IdxVille        8
#define ADR_IdxTel          9
#define ADR_IdxFAX          10
#define ADR_Denomination( LstAdr) ((TStringList *)LstAdr)->Strings[ADR_IdxDenomination]
#define ADR_CmplAdr1( LstAdr)     ((TStringList *)LstAdr)->Strings[ADR_IdxCmplAdr1    ]
#define ADR_CmplAdr2( LstAdr)     ((TStringList *)LstAdr)->Strings[ADR_IdxCmplAdr2    ]
#define ADR_NoVoie( LstAdr)       ((TStringList *)LstAdr)->Strings[ADR_IdxNoVoie      ]
#define ADR_CmplNoVoie( LstAdr)   ((TStringList *)LstAdr)->Strings[ADR_IdxCmplNoVoie  ]
#define ADR_NomVoie( LstAdr)      ((TStringList *)LstAdr)->Strings[ADR_IdxNomVoie     ]
#define ADR_BP( LstAdr)           ((TStringList *)LstAdr)->Strings[ADR_IdxBP          ]
#define ADR_CP( LstAdr)           ((TStringList *)LstAdr)->Strings[ADR_IdxCP          ]
#define ADR_Ville( LstAdr)        ((TStringList *)LstAdr)->Strings[ADR_IdxVille       ]
#define ADR_Tel( LstAdr)          ((TStringList *)LstAdr)->Strings[ADR_IdxTel         ]
#define ADR_FAX( LstAdr)          ((TStringList *)LstAdr)->Strings[ADR_IdxFAX         ]
#define MAX_LI_ADR                10
enum TYPE_BANDE{
    e_Etat              = 0x0001,

    e_EnTete            = 0x0002,
    e_Debut             = 0x0004,

    e_DebutColonne      = 0x0008,
    e_ReportDebDePage   = 0x000B,

    e_Principal         = 0x0010,

    e_ReportFinDePage   = 0x0018,
    e_FinColonne        = 0x0020,
    e_SautDePage        = 0x0040,

    e_Fin               = 0x0100,
    e_ComplementPage    = 0x0200,
    e_Pied              = 0x0400,

    e_Utilisateur       = 0x8000
    };

enum Type_Champ {
    tc_Normal=0,
    tc_Programme,
    tc_BaseDeDonnee,
    tc_Calcule,
    tc_Max  = 4
};

typedef void __fastcall (__closure *TOnErrorEvent)    (const TObject *Object, const AnsiString &Message);
typedef bool __fastcall (__closure *TOnVariableEvent) (const TObject *Object, const AnsiString &Variable, TFieldType &Type, AnsiString &Valeur);

#endif
 